package com.jycrm.common;

import java.util.ArrayList;
import java.util.List;

public class PagedListHolder {
	public static final int DEFAULT_PAGE_SIZE=10; 
	private int pageSize;
	
	private int total;
	private List pageList = new ArrayList();
	private int page;
	
	
	public int getPage() {
		int pageCount = this.getPageCount();
		
		page = page<0?0:page;
		page = page>pageCount?pageCount:page;
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public List getPageList() {
		return pageList;
	}
	public void setPageList(List pageList) {
		this.pageList = pageList;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getTotal() {
		return total;
	}
	public void setTotal(int total) {
		this.total = total;
	}
	public int getPageCount() {
		pageSize =( pageSize!=0)?pageSize:DEFAULT_PAGE_SIZE;
		int pageCount = ((total%pageSize)==0)?(total/pageSize):(total/pageSize+1);
		return pageCount ;
	}
	
	
	
	
	

}
